//
//  BLCamBarcode.h
//  ITC_iOS
//
//  Created by Benz.L on 06/09/2018.
//  Copyright © 2018 Benz.L. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>

@interface BLCamBarcode : NSObject
@property(nonatomic, strong)    AVCaptureVideoPreviewLayer *previewLayer;
@property(nonatomic, strong)    CALayer *scanLayer;
@property(nonatomic, assign)    CGFloat videoZoomFactor; //聚焦
@property(nonatomic, readonly)  NSArray<AVMetadataObjectType> *metadataObjectTypes;
@property(nonatomic)            void(^barcodeResult)(NSString *result);

- (instancetype)initWithMetadataObjectTypes:(NSArray<AVMetadataObjectType> *)metadataObjectTypes;
- (void)startScan;
- (void)stop;

@end


@interface BLCamBarcode(QR)

+ (UIImage *)QRImageWithContent:(NSString *)content size:(CGFloat)size fillColor:(UIColor *)color;
+ (NSString *)contentFromQRImage:(UIImage *)image;

@end
